//
//  CZEmoticonButton.swift
//  keyBoard
//
//  Created by 李伟鹏 on 16/5/22.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit

class CZEmoticonButton: UIButton {

    var emoticonModel: CZEmoticonModel? {
        didSet {
            guard let emoticonModel = emoticonModel else {
                return
            }
           
            if emoticonModel.emoji != nil {
                self.setTitle(emoticonModel.emoji, forState: UIControlState.Normal)
                self.setImage(nil, forState: UIControlState.Normal)
            }else{
                self.setTitle(nil, forState: UIControlState.Normal)
                self.setImage(UIImage(named: emoticonModel.fullPngPath!), forState: UIControlState.Normal)
            }
        }
    }

}
